   package com.javalong.affairs.module.schedule.activity;

import java.util.Date;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.widget.FrameLayout;

import com.javalong.affairs.R;
import com.javalong.affairs.base.activity.UIHandlerActivity;
import com.javalong.affairs.base.constant.BundleKey;
import com.javalong.affairs.base.constant.RequestCode;
import com.javalong.affairs.module.schedule.fragment.MyScheduleFragment;
import com.javalong.affairs.base.ui.TopTitle;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ContentView;
import com.lidroid.xutils.view.annotation.ViewInject;

@ContentView(R.layout.activity_myschedule)
public class MyScheduleActivity extends UIHandlerActivity {
	@ViewInject(R.id.ui_toptitle)
	private TopTitle topTitle;
	private FrameLayout fl_content;
	private Date nowDate = new Date();
	private int currType = 0;
	private MyScheduleFragment f;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ViewUtils.inject(this);
		topTitle.setOnLeftDrawableClick(this);
		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		 f = new MyScheduleFragment();
		ft.add(R.id.fl_content, f);
		ft.commit();
	}
	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode == Activity.RESULT_OK) {
			switch (requestCode) {
			case RequestCode.EDITCONTENT:
				String editContent = data.getStringExtra(BundleKey.EDITCONTENT);
				f.setContent(editContent);
				break;
			}
		}
	}
}
